<!--
 * @Description: 
 * @Author: charles
 * @Date: 2021-12-14 22:17:25
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2021-12-22 20:23:37
-->
<template>
  <div class="engineer_details">
    <el-row>
      <el-col >
        <el-button type="text" @click="backhandler">返回</el-button>
        <el-divider direction="vertical"></el-divider>
        <span class="label" size="large">工单详情</span>
      </el-col>
    </el-row>
    <div class="engineer">
      <el-row>
        <el-col :span="12">
          <span class="label">工程名称</span>
          <span class="value">{{engineer.engineer_name}}</span>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <span class="label">设备名称</span>
          <span class="value">{{engineer.device_name}}</span>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <span class="label">工程状态</span>
          <span class="value">{{engineer.status}}</span>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <span class="label">工程类型</span>
          <span class="value">{{engineer.type}}</span>
        </el-col>
      </el-row>
    </div>
  </div>
</template>
<script>
import {get} from '@/utils/request'
export default {
  data(){
    return {
      engineer:{},
      form:{},
      devices:[],
      bindedDevices:[]
    }
  },
  mounted() {
    this.engineer = this.$route.query;
    // 查询该工单信息
    this.loadworkorderDevices();
  },
  methods:{
    // 加载该工程绑定的设备信息
    loadworkorderDevices(){
      let url = "/workorder/pageQuery"
      let params = {page:1,pageSize:1000,engineer_id:this.engineer.id}
      get(url,params).then(resp => {
        this.bindedDevices = resp.data.list;
      })
    },
    backhandler(){
      this.$router.go(-1);
    }
  }
}
</script>
<style scoped>
.engineer_details .engineer .label{
  font-weight: bold;
  padding-right: 5px;
  line-height: 2.4em;
}
</style>